home *** CD-ROM | disk | FTP | other *** search
/ Sprite 1984 - 1993 / Sprite 1984 - 1993.iso / man / lib.fmt / c / getpriority.man < prev    next >
Encoding:
Text File  |  1989-07-14  |  3.1 KB  |  133 lines

  1.  
  2.  
  3.  
  4. GETPRIORITY           C Library Procedures            GETPRIORITY
  5.  
  6.  
  7.  
  8. NNAAMMEE
  9.      getpriority, setpriority - get/set program scheduling prior-
  10.      ity
  11.  
  12. SSYYNNOOPPSSIISS
  13.      ##iinncclluuddee <<ssyyss//rreessoouurrccee..hh>>
  14.  
  15.      pprriioo == ggeettpprriioorriittyy((wwhhiicchh,, wwhhoo))
  16.      iinntt pprriioo,, wwhhiicchh,, wwhhoo;;
  17.  
  18.      sseettpprriioorriittyy((wwhhiicchh,, wwhhoo,, pprriioo))
  19.      iinntt wwhhiicchh,, wwhhoo,, pprriioo;;
  20.  
  21. DDEESSCCRRIIPPTTIIOONN
  22.      The scheduling priority of the process, process group, or
  23.      user, as indicated by _w_h_i_c_h and _w_h_o is obtained with the
  24.      _g_e_t_p_r_i_o_r_i_t_y call and set with the _s_e_t_p_r_i_o_r_i_t_y call.  _W_h_i_c_h
  25.      is one of PRIO_PROCESS, PRIO_PGRP, or PRIO_USER, and _w_h_o is
  26.      interpreted relative to _w_h_i_c_h (a process identifier for
  27.      PRIO_PROCESS, process group identifier for PRIO_PGRP, and a
  28.      user ID for PRIO_USER).  A zero value of _w_h_o denotes the
  29.      current process, process group, or user.  _P_r_i_o is a value in
  30.      the range -20 to 20.  The default priority is 0; lower
  31.      priorities cause more favorable scheduling.
  32.  
  33.      The _g_e_t_p_r_i_o_r_i_t_y call returns the highest priority (lowest
  34.      numerical value) enjoyed by any of the specified processes.
  35.      The _s_e_t_p_r_i_o_r_i_t_y call sets the priorities of all of the
  36.      specified processes to the specified value.  Only the
  37.      super-user may lower priorities.
  38.  
  39. RREETTUURRNN VVAALLUUEE
  40.      Since _g_e_t_p_r_i_o_r_i_t_y can legitimately return the value -1, it
  41.      is necessary to clear the external variable _e_r_r_n_o prior to
  42.      the call, then check it afterward to determine if a -1 is an
  43.      error or a legitimate value.  The _s_e_t_p_r_i_o_r_i_t_y call returns 0
  44.      if there is no error, or -1 if there is.
  45.  
  46. EERRRROORRSS
  47.      _G_e_t_p_r_i_o_r_i_t_y and _s_e_t_p_r_i_o_r_i_t_y may return one of the following
  48.      errors:
  49.  
  50.      [ESRCH]        No process was located using the _w_h_i_c_h and
  51.                     _w_h_o values specified.
  52.  
  53.      [EINVAL]       _W_h_i_c_h was not one of PRIO_PROCESS, PRIO_PGRP,
  54.                     or PRIO_USER.
  55.  
  56.      In addition to the errors indicated above, _s_e_t_p_r_i_o_r_i_t_y may
  57.      fail with one of the following errors returned:
  58.  
  59.      [EPERM]        A process was located, but neither its
  60.  
  61.  
  62.  
  63. Sprite v1.0               May 22, 1986                          1
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70. GETPRIORITY           C Library Procedures            GETPRIORITY
  71.  
  72.  
  73.  
  74.                     effective nor real user ID matched the effec-
  75.                     tive user ID of the caller.
  76.  
  77.      [EACCES]       A non super-user attempted to lower a process
  78.                     priority.
  79.  
  80. SSEEEE AALLSSOO
  81.      nice(1), fork(2), renice(8)
  82.  
  83.  
  84.  
  85.  
  86.  
  87.  
  88.  
  89.  
  90.  
  91.  
  92.  
  93.  
  94.  
  95.  
  96.  
  97.  
  98.  
  99.  
  100.  
  101.  
  102.  
  103.  
  104.  
  105.  
  106.  
  107.  
  108.  
  109.  
  110.  
  111.  
  112.  
  113.  
  114.  
  115.  
  116.  
  117.  
  118.  
  119.  
  120.  
  121.  
  122.  
  123.  
  124.  
  125.  
  126.  
  127.  
  128.  
  129. Sprite v1.0               May 22, 1986                          2
  130.  
  131.  
  132.  
  133.